Integrand size = 13, antiderivative size = 112 \[ \int \frac {\csc ^5(x)}{a+b \csc (x)} \, dx=\frac {a \left (2 a^2+b^2\right ) \text {arctanh}(\cos (x))}{2 b^4}-\frac {2 a^4 \text {arctanh}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{b^4 \sqrt {a^2-b^2}}-\frac {\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac {a \cot (x) \csc (x)}{2 b^2}-\frac {\cot (x) \csc ^2(x)}{3 b} \]
[Out]
Time = 0.44 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.692, Rules used = {3936, 4177, 4167, 4083, 3855, 3916, 2739, 632, 212} \[ \int \frac {\csc ^5(x)}{a+b \csc (x)} \, dx=\frac {a \left (2 a^2+b^2\right ) \text {arctanh}(\cos (x))}{2 b^4}-\frac {\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}-\frac {2 a^4 \text {arctanh}\left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {a^2-b^2}}\right )}{b^4 \sqrt {a^2-b^2}}+\frac {a \cot (x) \csc (x)}{2 b^2}-\frac {\cot (x) \csc ^2(x)}{3 b} \]
[In]
[Out]
Rule 212
Rule 632
Rule 2739
Rule 3855
Rule 3916
Rule 3936
Rule 4083
Rule 4167
Rule 4177
Rubi steps \begin{align*} \text {integral}& = -\frac {\cot (x) \csc ^2(x)}{3 b}+\frac {\int \frac {\csc ^2(x) \left (2 a+2 b \csc (x)-3 a \csc ^2(x)\right )}{a+b \csc (x)} \, dx}{3 b} \\ & = \frac {a \cot (x) \csc (x)}{2 b^2}-\frac {\cot (x) \csc ^2(x)}{3 b}+\frac {\int \frac {\csc (x) \left (-3 a^2+a b \csc (x)+2 \left (3 a^2+2 b^2\right ) \csc ^2(x)\right )}{a+b \csc (x)} \, dx}{6 b^2} \\ & = -\frac {\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac {a \cot (x) \csc (x)}{2 b^2}-\frac {\cot (x) \csc ^2(x)}{3 b}+\frac {\int \frac {\csc (x) \left (-3 a^2 b-3 a \left (2 a^2+b^2\right ) \csc (x)\right )}{a+b \csc (x)} \, dx}{6 b^3} \\ & = -\frac {\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac {a \cot (x) \csc (x)}{2 b^2}-\frac {\cot (x) \csc ^2(x)}{3 b}+\frac {a^4 \int \frac {\csc (x)}{a+b \csc (x)} \, dx}{b^4}-\frac {\left (a \left (2 a^2+b^2\right )\right ) \int \csc (x) \, dx}{2 b^4} \\ & = \frac {a \left (2 a^2+b^2\right ) \text {arctanh}(\cos (x))}{2 b^4}-\frac {\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac {a \cot (x) \csc (x)}{2 b^2}-\frac {\cot (x) \csc ^2(x)}{3 b}+\frac {a^4 \int \frac {1}{1+\frac {a \sin (x)}{b}} \, dx}{b^5} \\ & = \frac {a \left (2 a^2+b^2\right ) \text {arctanh}(\cos (x))}{2 b^4}-\frac {\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac {a \cot (x) \csc (x)}{2 b^2}-\frac {\cot (x) \csc ^2(x)}{3 b}+\frac {\left (2 a^4\right ) \text {Subst}\left (\int \frac {1}{1+\frac {2 a x}{b}+x^2} \, dx,x,\tan \left (\frac {x}{2}\right )\right )}{b^5} \\ & = \frac {a \left (2 a^2+b^2\right ) \text {arctanh}(\cos (x))}{2 b^4}-\frac {\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac {a \cot (x) \csc (x)}{2 b^2}-\frac {\cot (x) \csc ^2(x)}{3 b}-\frac {\left (4 a^4\right ) \text {Subst}\left (\int \frac {1}{-4 \left (1-\frac {a^2}{b^2}\right )-x^2} \, dx,x,\frac {2 a}{b}+2 \tan \left (\frac {x}{2}\right )\right )}{b^5} \\ & = \frac {a \left (2 a^2+b^2\right ) \text {arctanh}(\cos (x))}{2 b^4}-\frac {2 a^4 \text {arctanh}\left (\frac {b \left (\frac {a}{b}+\tan \left (\frac {x}{2}\right )\right )}{\sqrt {a^2-b^2}}\right )}{b^4 \sqrt {a^2-b^2}}-\frac {\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac {a \cot (x) \csc (x)}{2 b^2}-\frac {\cot (x) \csc ^2(x)}{3 b} \\ \end{align*}
Time = 2.10 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.12 \[ \int \frac {\csc ^5(x)}{a+b \csc (x)} \, dx=\frac {\frac {24 a^4 \arctan \left (\frac {a+b \tan \left (\frac {x}{2}\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}+b \left (3 a^2+2 b^2\right ) \cos (3 x) \csc ^3(x)-3 b \cot (x) \csc (x) \left (-2 a b+\left (a^2+2 b^2\right ) \csc (x)\right )+6 a \left (2 a^2+b^2\right ) \left (\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right )}{12 b^4} \]
[In]
[Out]
Time = 0.75 (sec) , antiderivative size = 156, normalized size of antiderivative = 1.39
method | result | size |
default | \(\frac {\frac {\tan \left (\frac {x}{2}\right )^{3} b^{2}}{3}-a b \tan \left (\frac {x}{2}\right )^{2}+4 \tan \left (\frac {x}{2}\right ) a^{2}+3 \tan \left (\frac {x}{2}\right ) b^{2}}{8 b^{3}}+\frac {2 a^{4} \arctan \left (\frac {2 b \tan \left (\frac {x}{2}\right )+2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{b^{4} \sqrt {-a^{2}+b^{2}}}-\frac {1}{24 b \tan \left (\frac {x}{2}\right )^{3}}-\frac {4 a^{2}+3 b^{2}}{8 b^{3} \tan \left (\frac {x}{2}\right )}+\frac {a}{8 b^{2} \tan \left (\frac {x}{2}\right )^{2}}-\frac {a \left (2 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {x}{2}\right )\right )}{2 b^{4}}\) | \(156\) |
risch | \(\frac {i \left (3 i a b \,{\mathrm e}^{5 i x}-6 a^{2} {\mathrm e}^{4 i x}-3 i a b \,{\mathrm e}^{i x}+12 a^{2} {\mathrm e}^{2 i x}+12 b^{2} {\mathrm e}^{2 i x}-6 a^{2}-4 b^{2}\right )}{3 b^{3} \left ({\mathrm e}^{2 i x}-1\right )^{3}}-\frac {i a^{4} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {-a^{2}+b^{2}}\, b +a^{2}-b^{2}\right )}{a \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, b^{4}}+\frac {i a^{4} \ln \left ({\mathrm e}^{i x}+\frac {i \left (\sqrt {-a^{2}+b^{2}}\, b -a^{2}+b^{2}\right )}{a \sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, b^{4}}+\frac {a^{3} \ln \left ({\mathrm e}^{i x}+1\right )}{b^{4}}+\frac {a \ln \left ({\mathrm e}^{i x}+1\right )}{2 b^{2}}-\frac {a^{3} \ln \left ({\mathrm e}^{i x}-1\right )}{b^{4}}-\frac {a \ln \left ({\mathrm e}^{i x}-1\right )}{2 b^{2}}\) | \(269\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 280 vs. \(2 (98) = 196\).
Time = 0.35 (sec) , antiderivative size = 607, normalized size of antiderivative = 5.42 \[ \int \frac {\csc ^5(x)}{a+b \csc (x)} \, dx=\left [\frac {4 \, {\left (3 \, a^{4} b - a^{2} b^{3} - 2 \, b^{5}\right )} \cos \left (x\right )^{3} - 6 \, {\left (a^{4} \cos \left (x\right )^{2} - a^{4}\right )} \sqrt {a^{2} - b^{2}} \log \left (-\frac {{\left (a^{2} - 2 \, b^{2}\right )} \cos \left (x\right )^{2} + 2 \, a b \sin \left (x\right ) + a^{2} + b^{2} - 2 \, {\left (b \cos \left (x\right ) \sin \left (x\right ) + a \cos \left (x\right )\right )} \sqrt {a^{2} - b^{2}}}{a^{2} \cos \left (x\right )^{2} - 2 \, a b \sin \left (x\right ) - a^{2} - b^{2}}\right ) \sin \left (x\right ) + 6 \, {\left (a^{3} b^{2} - a b^{4}\right )} \cos \left (x\right ) \sin \left (x\right ) + 3 \, {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4} - {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4}\right )} \cos \left (x\right )^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \sin \left (x\right ) - 3 \, {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4} - {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4}\right )} \cos \left (x\right )^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \sin \left (x\right ) - 12 \, {\left (a^{4} b - b^{5}\right )} \cos \left (x\right )}{12 \, {\left (a^{2} b^{4} - b^{6} - {\left (a^{2} b^{4} - b^{6}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}, \frac {4 \, {\left (3 \, a^{4} b - a^{2} b^{3} - 2 \, b^{5}\right )} \cos \left (x\right )^{3} + 12 \, {\left (a^{4} \cos \left (x\right )^{2} - a^{4}\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \sin \left (x\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \cos \left (x\right )}\right ) \sin \left (x\right ) + 6 \, {\left (a^{3} b^{2} - a b^{4}\right )} \cos \left (x\right ) \sin \left (x\right ) + 3 \, {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4} - {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4}\right )} \cos \left (x\right )^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \sin \left (x\right ) - 3 \, {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4} - {\left (2 \, a^{5} - a^{3} b^{2} - a b^{4}\right )} \cos \left (x\right )^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \sin \left (x\right ) - 12 \, {\left (a^{4} b - b^{5}\right )} \cos \left (x\right )}{12 \, {\left (a^{2} b^{4} - b^{6} - {\left (a^{2} b^{4} - b^{6}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}\right ] \]
[In]
[Out]
\[ \int \frac {\csc ^5(x)}{a+b \csc (x)} \, dx=\int \frac {\csc ^{5}{\left (x \right )}}{a + b \csc {\left (x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\csc ^5(x)}{a+b \csc (x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 194, normalized size of antiderivative = 1.73 \[ \int \frac {\csc ^5(x)}{a+b \csc (x)} \, dx=\frac {2 \, {\left (\pi \left \lfloor \frac {x}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (\frac {1}{2} \, x\right ) + a}{\sqrt {-a^{2} + b^{2}}}\right )\right )} a^{4}}{\sqrt {-a^{2} + b^{2}} b^{4}} + \frac {b^{2} \tan \left (\frac {1}{2} \, x\right )^{3} - 3 \, a b \tan \left (\frac {1}{2} \, x\right )^{2} + 12 \, a^{2} \tan \left (\frac {1}{2} \, x\right ) + 9 \, b^{2} \tan \left (\frac {1}{2} \, x\right )}{24 \, b^{3}} - \frac {{\left (2 \, a^{3} + a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{2 \, b^{4}} + \frac {44 \, a^{3} \tan \left (\frac {1}{2} \, x\right )^{3} + 22 \, a b^{2} \tan \left (\frac {1}{2} \, x\right )^{3} - 12 \, a^{2} b \tan \left (\frac {1}{2} \, x\right )^{2} - 9 \, b^{3} \tan \left (\frac {1}{2} \, x\right )^{2} + 3 \, a b^{2} \tan \left (\frac {1}{2} \, x\right ) - b^{3}}{24 \, b^{4} \tan \left (\frac {1}{2} \, x\right )^{3}} \]
[In]
[Out]
Time = 19.02 (sec) , antiderivative size = 588, normalized size of antiderivative = 5.25 \[ \int \frac {\csc ^5(x)}{a+b \csc (x)} \, dx=-\frac {b^2\,\left (\frac {3\,a\,\sin \left (2\,x\right )\,\sqrt {a^2-b^2}}{4}+\frac {3\,a\,\sin \left (3\,x\right )\,\ln \left (\frac {\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )}\right )\,\sqrt {a^2-b^2}}{8}-\frac {9\,a\,\ln \left (\frac {\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )}\right )\,\sin \left (x\right )\,\sqrt {a^2-b^2}}{8}\right )+b^3\,\left (\frac {\cos \left (3\,x\right )\,\sqrt {a^2-b^2}}{2}-\frac {3\,\cos \left (x\right )\,\sqrt {a^2-b^2}}{2}\right )-b\,\left (\frac {3\,a^2\,\cos \left (x\right )\,\sqrt {a^2-b^2}}{4}-\frac {3\,a^2\,\cos \left (3\,x\right )\,\sqrt {a^2-b^2}}{4}\right )-\frac {9\,a^3\,\ln \left (\frac {\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )}\right )\,\sin \left (x\right )\,\sqrt {a^2-b^2}}{4}+\frac {3\,a^3\,\sin \left (3\,x\right )\,\ln \left (\frac {\sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )}\right )\,\sqrt {a^2-b^2}}{4}+\frac {a^4\,\mathrm {atan}\left (\frac {a^4\,\sin \left (\frac {x}{2}\right )\,\sqrt {a^2-b^2}\,8{}\mathrm {i}-b^4\,\sin \left (\frac {x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}+a\,b^3\,\cos \left (\frac {x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}+a^3\,b\,\cos \left (\frac {x}{2}\right )\,\sqrt {a^2-b^2}\,4{}\mathrm {i}}{-8\,\sin \left (\frac {x}{2}\right )\,a^5-4\,\cos \left (\frac {x}{2}\right )\,a^4\,b+4\,\sin \left (\frac {x}{2}\right )\,a^3\,b^2+\cos \left (\frac {x}{2}\right )\,a^2\,b^3+2\,\sin \left (\frac {x}{2}\right )\,a\,b^4+\cos \left (\frac {x}{2}\right )\,b^5}\right )\,\sin \left (x\right )\,9{}\mathrm {i}}{2}-\frac {a^4\,\mathrm {atan}\left (\frac {a^4\,\sin \left (\frac {x}{2}\right )\,\sqrt {a^2-b^2}\,8{}\mathrm {i}-b^4\,\sin \left (\frac {x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}+a\,b^3\,\cos \left (\frac {x}{2}\right )\,\sqrt {a^2-b^2}\,1{}\mathrm {i}+a^3\,b\,\cos \left (\frac {x}{2}\right )\,\sqrt {a^2-b^2}\,4{}\mathrm {i}}{-8\,\sin \left (\frac {x}{2}\right )\,a^5-4\,\cos \left (\frac {x}{2}\right )\,a^4\,b+4\,\sin \left (\frac {x}{2}\right )\,a^3\,b^2+\cos \left (\frac {x}{2}\right )\,a^2\,b^3+2\,\sin \left (\frac {x}{2}\right )\,a\,b^4+\cos \left (\frac {x}{2}\right )\,b^5}\right )\,\sin \left (3\,x\right )\,3{}\mathrm {i}}{2}}{\frac {3\,b^4\,\sin \left (3\,x\right )\,\sqrt {a^2-b^2}}{4}-\frac {9\,b^4\,\sin \left (x\right )\,\sqrt {a^2-b^2}}{4}} \]
[In]
[Out]